<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User extends CI_Controller {

	function __construct() {
	   
        parent::__construct();
        $this->load->model("user_model");   
	}
	public function index()
	{	
		if(UtilHelp::isLogin())
		{
			redirect();
		}else{
		  
            
		}
		
        $data = array();        
        $this->load->view('member/home/');
        
	}
    
    public function register(){
        
        $data = array();   
        $param=array();
        
        if(isset($_POST) and !empty($_POST)){
            
            if(isset($_POST['email_address']) && $_POST['email_address'] != '' ){
                
                $param['email'] = mysql_real_escape_string($_POST['email_address']);
            }
            if(isset($_POST['password']) && $_POST['password'] != '' ){
                
                $param['password'] = md5(mysql_real_escape_string($_POST['password']));
            }
          
            $insert=$this->user_model->insertUser($param);
            
            
        }
             
        $data['content']=$this->load->view('user/register',$data,true);
        $this->load->view('user',$data);
        
    }
    
    
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */